#define _CRT_SECURE_NO_WARNINGS
#include "Sort.h"

void TestInsertSort()
{
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestShellSort() {
	//int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	int a[] = { 5,2,3,1 };
	ShellSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestSelectSort() {
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	SelectSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));

}
void TestBubbleSort() {
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestQuickSort() {
	//int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	QuickSort(a, 0,sizeof(a) / sizeof(int)-1);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestQuickSortNonR1() {
	int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	QuickSortNonR1(a, 0, sizeof(a) / sizeof(int) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestQuickSortNonR2() {
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	//int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	QuickSortNonR2(a, 0, sizeof(a) / sizeof(int) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestMergeSort() {
	//int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	MergeSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestMergeSortNonR() {
	int a[] = { 9, 1, 2, 5, 7, 4, 8, 6, 3, 5 };
	//int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	//int a[] = { -2,3,-5 };
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestCountSort() {
	int a[] = { -9, 1, 2, 5, 7,9, 4, 8, 6, 3, -5 };
	//int a[] = { 6, 1, 2, 7, 9, 3, 4, 5, 10, 8 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	//int a[] = { -2,3,-5 };
	CountSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestBubbleSort();
	//TestQuickSort();
	//TestQuickSortNonR1();
	//TestMergeSort();
	//TestMergeSortNonR();
	//TestCountSort();
	return 0;
}